package com.xw.childhealth.service.impl;

import com.xw.childhealth.dao.BasicDataDao;
import com.xw.childhealth.entity.BasicData;
import com.xw.childhealth.entity.PersonnelCode;
import com.xw.childhealth.service.BasicDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @Author: y
 * @CreateDate: 2019-11-27 08:38
 * @Version: 1.0
 */
@Service
public class BasicDataServiceImpl implements BasicDataService {

    @Autowired
    private BasicDataDao dao;

    @Override
    public BasicData save(BasicData obj) {

        return dao.save(obj);
    }

    @Override
    public void delById(Integer id) {
        dao.deleteById(id);
    }

    @Override
    public BasicData findById(Integer id) {
        return dao.findById(id).orElse(null);
    }

    @Override
    public Page<BasicData> findAll(Specification<BasicData> specification, PageRequest pageRequest) {
        return dao.findAll(specification, pageRequest);
    }
}
